﻿using System;
using System.Drawing;
using System.Windows.Forms;
using System.Windows.Media;
using Styx.Common;

namespace WuzzCollection.GUI
{
    public partial class SettingsForm : Form
    {
        public SettingsForm()
        {
            InitializeComponent();
            this.Icon = Icon.ExtractAssociatedIcon(Application.ExecutablePath);
        }

        private void SettingsForm_Load(object sender, EventArgs e)
        {
            if (!BotSettings.BotMovement)
                checkDisableMovement.Checked = true;

            if (!BotSettings.BotTargeting)
                checkDisableTargeting.Checked = true;

            if (!BotSettings.BotTaunt)
                checkDisableTaunt.Checked = true;

            if (!BotSettings.BotCooldowns)
                checkDisableCooldowns.Checked = true;

            if (!BotSettings.BotAOE)
                checkDisableAOE.Checked = true;
        }

        private void checkDisableMovement_CheckedChanged(object sender, EventArgs e)
        {
            if (checkDisableMovement.Checked)
            {
                BotSettings.BotMovement = false;
                Logging.Write(Colors.Orange, "== Bot movement disabled!");
            }
            else
            {
                BotSettings.BotMovement = true;
                Logging.Write(Colors.Orange, "== Bot movement enabled!");
            }
        }

        private void checkDisableAOE_CheckedChanged(object sender, EventArgs e)
        {
            if (checkDisableAOE.Checked)
            {
                BotSettings.BotAOE = false;
                Logging.Write(Colors.Orange, "== Area of Effect spells disabled!");
            }
            else
            {
                BotSettings.BotAOE = true;
                Logging.Write(Colors.Orange, "== Area of Effect spells enabled!");
            }
        }

        private void checkDisableTaunt_CheckedChanged(object sender, EventArgs e)
        {
            if (checkDisableTaunt.Checked)
            {
                BotSettings.BotTaunt = false;
                Logging.Write(Colors.Orange, "== Taunting disabled!");
            }
            else
            {
                BotSettings.BotTaunt = true;
                Logging.Write(Colors.Orange, "== Taunting enabled!");
            }
        }

        private void checkDisableTargeting_CheckedChanged(object sender, EventArgs e)
        {
            if (checkDisableTargeting.Checked)
            {
                BotSettings.BotTargeting = false;
                Logging.Write(Colors.Orange, "== Bot targeting disabled!");
            }
            else
            {
                BotSettings.BotTargeting = true;
                Logging.Write(Colors.Orange, "== Bot targeting enabled!");
            }
        }

        private void checkDisableCooldowns_CheckedChanged(object sender, EventArgs e)
        {
            if (checkDisableCooldowns.Checked)
            {
                BotSettings.BotCooldowns = false;
                Logging.Write(Colors.Orange, "== Cooldowns disabled!");
            }
            else
            {
                BotSettings.BotCooldowns = true;
                Logging.Write(Colors.Orange, "== Cooldowns enabled!");
            }
        }
    }
}
